'''

静态方法：与类对象无关；和模块中的普通函数没有区别，只是放在了类的名字空间里，可以通过类名调用
'''

class Student:
    company = "WY"
    __secret = "lewd"

    def __del__(self):
        print()
    def __repr__(self):
        return "abc"

    def __str__(self):
        return "xxyxx"
    def __init__(self):
        self.shit="shit"
    # 在它名下，但与它无关
    @staticmethod
    def printCompany():
        print("company")
    def test(self):
        print("test")

Student.printCompany()

print(dir(Student))
print(Student()._Student__secret)
print(Student._Student__secret)

print(Student().company)
print(Student.company)
print(Student().shit)
# print(Student.shit)
print("str:", Student())
print("repr:", repr(Student()))
print("str2","**"+str(Student())+"**")

'''
str对应__str__结果，面向用户
repr对应__repr_结果，面向程序员
print(obj)打印其 调用优先__str__, 没有则是__repr__的结果
'''